var DivLoaded = new Array;
var CurrentDiv;

function triggerSignups(BlockName, img_name, img_plus, img_minus, user_id)
{
	if($(BlockName).visible()){
		$(img_name).src=img_plus;
		
		new Effect.BlindUp(BlockName, { duration: 0.5});
		
	}
	else {
	
		
		
		$(img_name).src=img_minus;

		new Ajax.Updater(BlockName, '/signups.php',  { method: 'get', parameters: {rid: BlockName, uid: user_id},
		onSuccess: function(transport){
			new Effect.Appear(BlockName);
    	}
		});
		
		
		
	}
}

function updateSignups(BlockName, user_id, type)
{
	var sort_container = $('sort_container' + BlockName).visible();
	
		new Ajax.Updater(BlockName, '/signups.php',  { method: 'get', parameters: {rid: BlockName, uid: user_id, type: type, container: sort_container}
    	});

}

function triggerBalance(BlockName, img_name, img_plus, img_minus, user_id)
{
	if($(BlockName).visible()){
		$(img_name).src=img_plus;
		new Effect.BlindUp(BlockName, { duration: 0.5});
	}
	else {
		
	
		$(img_name).src=img_minus;

		new Ajax.Updater(BlockName, '/raid_balance.php',  { method: 'get', parameters: {rid: BlockName, uid: user_id} });
		
		new Effect.Appear(BlockName);
	}
		
}


function deleteUser(user_id, page) {
	if (confirm("Are you sure you want to delete this user from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&user_id=' + user_id;
	}
}

function deleteCharacter(pid, page) {
	if (confirm("Are you sure you want to delete this character from the system?")) {
		location = 'index.php?page=' + page + '&remove_player=' + pid;
	}
}

function deleteRaid(rid, page) {
	if (confirm("Are you sure you want to delete this raid from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&raid_id=' + rid;
	}
}

function deleteNews(nid, page) {
	if (confirm("Are you sure you want to delete this news item from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&news_id=' + nid;
	}
}

function deleteDownload(did, page) {
	if (confirm("Are you sure you want to delete this download from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&download_id=' + did;
	}
}

function deleteAttribute(aid, page) {
	if (confirm("Are you sure you want to delete this attribute from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&attribute_id=' + aid;
	}
}

function deleteTeam(tid, page) {
	if (confirm("Are you sure you want to delete this team from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&team_id=' + tid;
	}
}

function deleteRpCategory(cid, page) {
	if (confirm("Are you sure you want to delete this category from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&category_id=' + cid;
	}
}

function deleteEvent(eid, page) {
	if (confirm("Are you sure you want to delete this event from the system?")) {
		location = 'index.php?page=' + page + '&action=remove&event_id=' + eid;
	}
}

var getStrength = function(passwd) {
	intScore = 0;
	if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter
			{
			intScore = (intScore+1)
			} if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter
			{
			intScore = (intScore+5)
			} // NUMBERS
			if (passwd.match(/\d+/)) // [verified] at least one number
			{
			intScore = (intScore+5)
			} if (passwd.match(/(\d.*\d.*\d)/)) // [verified] at least three numbers
			{
			intScore = (intScore+5)
			} // SPECIAL CHAR
			if (passwd.match(/[!,@#$%^&*?_~]/)) // [verified] at least one special character
			{
			intScore = (intScore+5)
			} if (passwd.match(/([!,@#$%^&*?_~].*[!,@#$%^&*?_~])/)) // [verified] at least two special characters
			{
			intScore = (intScore+5)
			} // COMBOS
			if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/)) // [verified] both upper and lower case
			{
			intScore = (intScore+2)
			} if (passwd.match(/\d/) && passwd.match(/\D/)) // [verified] both letters and numbers
			{
			intScore = (intScore+2)
			} // [Verified] Upper Letters, Lower Letters, numbers and special characters
			if (passwd.match(/[a-z]/) && passwd.match(/[A-Z]/) && passwd.match(/\d/) && passwd.match(/[!,@#$%^&*?_~]/))
			{
			intScore = (intScore+2)
			}
			return intScore;
}


//-->